package com.mtw.bbs.bbsUser.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

import com.mtw.bbs.common.jdbcBase.entity.BaseEntity;
import com.mtw.bbs.userAdmin.pojo.vo.MenuVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.Data;

/**
 * 菜单表
 *
 * @author mo
 * @email mo
 * @date 2023-10-23 10:15:12
 */
@Data
@TableName("os_menu")
@ApiModel("菜单表")
public class Menu extends BaseEntity implements Serializable{
	private static final long serialVersionUID = 1L;

	/**
	 * 唯一uid
	 */
	@TableId
	@ApiModelProperty(value = "唯一uid")
	private String id;
	/**
	 * 菜单名称
	 */
	@ApiModelProperty(value = "菜单名称")
	private String name;

	/**
	 * 简介
	 */
	@ApiModelProperty(value = "简介")
	private String summary;
	/**
	 * 父uid
	 */
	@ApiModelProperty(value = "父uid")
	private String parentId;
	/**
	 * url地址
	 */
	@ApiModelProperty(value = "url地址")
	private String url;
	/**
	 * 图标
	 */
	@ApiModelProperty(value = "图标")
	private String icon;


	@ApiModelProperty(value = "排序字段，越小越靠前")
	private Integer sort;
	/**
	 * 是否显示
	 */
	@ApiModelProperty(value = "是否显示 1:是 0:否")
	private Boolean isShow;
	/**
	 * 菜单类型 0: 菜单   1: 按钮
	 */
	@ApiModelProperty(value = "菜单类型 0: 菜单   1: 按钮")
	private Integer menuType;
	/**
	 * 是否跳转外部链接 0：否，1：是
	 */
	@ApiModelProperty(value = "是否跳转外部链接 0：否，1：是")
	private Integer isJumpExternalUrl;


	public MenuVo toVo(){
		MenuVo menuVo = new MenuVo();
		menuVo.setId(this.getId());
		menuVo.setName(this.getName());
		menuVo.setSummary(this.getSummary());
		menuVo.setParentId(this.getParentId());
		menuVo.setUrl(this.getUrl());
		menuVo.setIcon(this.getIcon());
		menuVo.setSort(this.getSort());
		menuVo.setIsShow(this.getIsShow());
		menuVo.setMenuType(this.getMenuType());
		menuVo.setIsJumpExternalUrl(this.getIsJumpExternalUrl());
		menuVo.setStatus(this.getStatus());
		return menuVo;
	}

}
